(function($) {
    function highlight($el, word) {
            var text = $el.html();
            text = text.replace(new RegExp(word,'gi'), '<span class="hl">'+word+'</span>');
            $el.html(text);
    }

    $.fn.highlight = function(word) {
            return this.each(function() {
                    highlight($(this), word);
            });
    };
}(jQuery));